﻿<loki:ViewControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxt="http://schemas.devexpress.com/winfx/2008/xaml/docking/themekeys"
    xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
    xmlns:dxwui="http://schemas.devexpress.com/winfx/2008/xaml/windowsui"
    x:Class="Luna.UI.Wpf.TabContainer"
    mc:Ignorable="d"
    x:TypeArguments="luna:OpenDocumentsViewModel"
    xmlns:loki="clr-namespace:Loki.UI.Wpf;assembly=Loki.UI.Wpf"
    xmlns:lc="clr-namespace:Loki.Commands;assembly=Loki.Core"
    xmlns:luna="clr-namespace:Luna.UI;assembly=Luna.Core"
    xmlns:local="clr-namespace:Luna.UI.Wpf"
    d:DesignHeight="1000" d:DesignWidth="800"
     xmlns:ve="http://schemas.devexpress.com/winfx/2008/xaml/docking/visualelements">
    <DockPanel LastChildFill="True">
        <dxwui:PageAdornerControl Header="{Binding ActiveDocument.FullDisplayName}" DockPanel.Dock="Top" />
        <dxdo:DockLayoutManager VerticalAlignment="Stretch" x:Name="dockManager" UseLayoutRounding="True" Margin="0" AllowDocumentSelector="True" AllowCustomization="False" FloatingMode="Desktop" Background="Transparent" ClosingBehavior="ImmediatelyRemove">
            <dxdo:LayoutGroup Background="Transparent" GroupBorderStyle="NoBorder">
                <dxdo:DocumentGroup x:Name="documentContainer" GroupBorderStyle="NoBorder"
                                    Background="Transparent" AllowFloat="False" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"
                                    DestroyOnClosingChildren="True" CaptionLocation="Left" CaptionOrientation="Horizontal" ClosePageButtonShowMode="InAllTabPageHeaders"
                    ItemWidth="1.52*"  ItemsSource="{Binding SubModels}" ClosingBehavior="ImmediatelyRemove" AllowDrag="False" AllowDock="False">
                    <dxdo:DocumentGroup.ItemStyle>
                        <Style TargetType="{x:Type dxdo:DocumentPanel}">
                            <Setter Property="CloseCommand" Value="{Binding Close}" />
                            <Setter Property="Caption" Value="{Binding DisplayName}" />
                            <Setter Property="ContentTemplate">
                                <Setter.Value>
                                    <DataTemplate>
                                        <loki:BusyIndicator BusyContent="{Binding Status}" IsBusy="{Binding IsBusy}">
                                            <DockPanel LastChildFill="True">
                                                <DockPanel.Background>
                                                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                                                        <GradientStop Color="#88000000" />
                                                        <GradientStop Color="#00888888" Offset="1" />
                                                    </LinearGradientBrush>
                                                </DockPanel.Background>
                                                <ContentPresenter Content="{TemplateBinding Content}" ContentTemplateSelector="{StaticResource LokiTemplateSelector}" />
                                            </DockPanel>
                                        </loki:BusyIndicator>
                                    </DataTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </dxdo:DocumentGroup.ItemStyle>
                </dxdo:DocumentGroup>
            </dxdo:LayoutGroup>
        </dxdo:DockLayoutManager>
    </DockPanel>
</loki:ViewControl>